using System.Collections.Generic;
namespace Algorithms
{
	public interface ISet<T>
	{
		void Add(T newElement);
		void Remove(T elementToRemove);
		bool Contains(T element);
		int Count { get; }
	}

	public class Set<T> : ISet<T>
	{
		private Dictionary<T, object> dict = new Dictionary<T, object>();

		public void Add(T newElement)
		{
			dict.Add(newElement, null);
		}

		public void Remove(T elementToRemove)
		{
			dict.Remove(elementToRemove);
		}

		public bool Contains(T element)
		{
			return dict.ContainsKey(element);
		}

		public int Count
		{
			get 
			{
				return dict.Keys.Count;
			}
		}
	}
}
